import java.util.ArrayDeque;
import java.util.Deque;
import java.util.LinkedList;

public class Deue {
    public static void main(String[] args) {
        Deque<Integer> deque=new LinkedList<>();
        Deque<Integer> deque1=new ArrayDeque<>();

        deque.addFirst(1);
        deque.addFirst(2);
        System.out.println(deque.peekFirst());
        System.out.println(deque.peekLast());
        System.out.println(deque.offerFirst(1));


    }
}
